<template>
  <!-- 新功能预告 -->
  <div class="box-card" v-skeleton.animated="loading">
    <h5 class="box-title">新功能预告</h5>
    <div class="box-card-list" v-if="previewData.length > 0">
      <ul class="list">
        <li v-skeleton-item v-for="(item, index) of previewData" :key="index">
          <div class="card-list-top">
            <h5 class="card-list-title">
              <img src="@app/base/assets/product-logos.png" alt="" />
              {{ item.title }}
            </h5>
            <span class="card-list-zan"><i class="MC_iconfont MC_icon-dianzan"></i> {{ item.zan }}</span>
          </div>
          <div class="card-list-bottom">
            <p>{{ item.content }}</p>
          </div>
        </li>
      </ul>
    </div>
    <div class="box-empty" v-else v-skeleton-item>
      <img src="@common/assets/empty.svg" alt="" />
      <span>暂无预告</span>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, reactive, toRefs } from 'vue'

export default defineComponent({
  name: 'newFeaturePreview',
  components: {},
  // ----------------生命周期-----------------------
  setup() {
    const state = reactive({
      previewData: [
        // {
        //   title: '原型渐变色',
        //   content: '支持设置渐变色,视觉效果更丰富',
        //   zan: 123
        // }
      ],
      loading: false
    })
    const skeletonTest = () => {
      state.loading = true
    }
    return {
      ...toRefs(state),
      skeletonTest
    }
  }
})
</script>

<style lang="stylus" scoped>
.box-card
  width 100%
  height 100%
  .box-title
    margin 0
    padding 20px 20px 16px
    width: 478px;
    height: 22px;
    font-style: normal;
    font-weight: 500;
    font-size: 16px;
    line-height: 22px;
    letter-spacing: 0.001em;
    color: rgba(0, 0, 0, 0.88);
    flex: none;
    order: 0;
    flex-grow: 1;
  .box-empty
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0px;
    gap: 4px;
    width: 100%;
    height calc(100% - 74px)
    flex: none;
    order: 1;
    align-self: stretch;
    flex-grow: 1;
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
  .box-card-list
    list-style none
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0 20px 20px;
    gap: 16px;
    width: 478px;
    // height calc(100% - 74px)
    flex: none;
    order: 1;
    align-self: stretch;
    flex-grow: 0;
    .list
      margin 0
      list-style none
      display: flex;
      flex-direction: row;
      align-items: flex-start;
      padding: 0px;
      gap: 16px;
      width: 478px;
      flex: none;
      order: 0;
      align-self: stretch;
      flex-grow: 0;
      flex-wrap:wrap-reverse
    li
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      padding: 16px;
      gap: 8px;
      height: 100px;
      background: var(--mc-gray1-color);
      border-radius: 4px;
      flex: 1;
      align-self: stretch;
      flex-grow: 1;
      box-sizing border-box
      .card-list-top
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 0px;
        width: 100%;
        height: 20px;
        flex: none;
        order: 0;
        align-self: stretch;
        flex-grow: 0;
      .card-list-bottom
        width: 100%;
        height: 18px;
        font-style: normal;
        font-weight: 400;
        font-size: 12px;
        line-height: 18px;
        display: flex;
        align-items: center;
        letter-spacing: 0.001em;
        color: rgba(0, 0, 0, 0.38);
        flex: none;
        order: 1;
        align-self: stretch;
        flex-grow: 0;
      .card-list-title
        margin 0
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 0px;
        gap: 4px;
        width: 163px;
        height: 20px;
        flex: none;
        order: 0;
        flex-grow: 1;
        font-style: normal;
        font-weight: 400;
        font-size: 14px;
        line-height: 20px;
      .card-list-zan
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 0px;
        gap: 4px;
        width: 36px;
        height: 18px;
        flex: none;
        order: 1;
        flex-grow: 0;
        color: rgba(0, 0, 0, 0.38);
        font-style: normal;
        font-weight: 400;
        font-size: 12px;
        line-height: 18px;
        i
          font-size: 12px;
          cursor pointer
</style>
